package com.xuhai.movie.util;

import java.util.Date;

/**
 * @Author PangJunjie
 * @Date 2022/4/7/007
 */
public class DateUtil {

    /*初始化默认分钟数*/
    private static final Integer INIT_MINUTES=5;
    /*初始化默认小时数*/
    private static final Integer INIT_HOURS=12;

    /**
     * 设置minutes分钟后的Date对象
     * @param minutes 分钟数
     * @return
     */
    public static Date addMinutes(Integer minutes){
        Date date = new Date();
        date.setMinutes(date.getMinutes()+minutes);
        return date;
    }

    public static Date addMinutes(){
        return addMinutes(INIT_MINUTES);
    }

    public static Date addHours(int hours){
        Date date = new Date();
        date.setHours(date.getHours()+hours);
        return date;
    }

    public static Date addHours(){
        return addHours(INIT_HOURS);
    }



}
